package com.dz.reflect;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;

public class ReflectDemo09 {
    public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchFieldException, InvocationTargetException, NoSuchMethodException {
        Class cls = Class.forName("com.dz.reflect.Son");

        // 反射出父类
        Class superclass = cls.getSuperclass();
        System.out.println(superclass.getSimpleName());
        System.out.println(Modifier.toString(superclass.getModifiers()));

        // 反射出接口
        Class[] interfaces = cls.getInterfaces();
        for (Class anInterface : interfaces) {
            System.out.println(anInterface.getSimpleName());
            System.out.println(Modifier.toString(anInterface.getModifiers()));
        }

    }

}
